Pull requests from blkfront into blkback a bit more
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sun, 4 Dec 2005 17:20:41 +0000 (18:20 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sun, 4 Dec 2005 17:20:41 +0000 (18:20 +0100)
aggressively, to keep the scheduling pipeline filled.

Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c

index fcc6c12de4d8b57aa33d83bf5f5751c3fec3ae9c..d9aee65e6916b357c2fc38dc47f3c4d19643722b 100644 (file)
@@ -493,12 +493,12 @@ static void make_response(blkif_t *blkif, unsigned long id,
        blk_ring->rsp_prod_pvt++;
        RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(blk_ring, notify);
 
-       /*
-         * Tail check for pending requests. Allows frontend to avoid
-         * notifications if requests are already in flight (lower overheads
-         * and promotes batching).
-         */
        if (blk_ring->rsp_prod_pvt == blk_ring->req_cons) {
+               /*
+                * Tail check for pending requests. Allows frontend to avoid
+                * notifications if requests are already in flight (lower
+                * overheads and promotes batching).
+                */
                int more_to_do;
                RING_FINAL_CHECK_FOR_REQUESTS(blk_ring, more_to_do);
                if (more_to_do) {
@@ -506,6 +506,12 @@ static void make_response(blkif_t *blkif, unsigned long id,
                        maybe_trigger_blkio_schedule();
                }
        }
+       else if (!__on_blkdev_list(blkif)
+                && RING_HAS_UNCONSUMED_REQUESTS(blk_ring)) {
+               /* Keep pulling requests as they become available... */
+               add_to_blkdev_list_tail(blkif);
+               maybe_trigger_blkio_schedule();
+       }
 
        spin_unlock_irqrestore(&blkif->blk_ring_lock, flags);